<?php
// +----------------------------------------------------------------------
// | 迁于首页
// +----------------------------------------------------------------------
// | Author: cart <469714167@qq.com>
// +----------------------------------------------------------------------
// | Datetime: 2018-5-16 14:59:00
// +----------------------------------------------------------------------
// | Copyright: 创讯科技
// +----------------------------------------------------------------------
namespace app\ice\controller;
use \think\Controller;
use think\Loader;
class Banner extends Controller
{
    // private $IndexModel;
    /**
     * [_initialize 初始化]
     * @return [type] [description]
     * @author carl
     * @version 2018-02-05
     * @copyright wei liang
     */
    protected function _initialize()
    {
        // parent::_initialize();
        $this->UserModel = Loader::model('User');
        $this->IndexModel = Loader::model('Banner');
    }

    public function index(){
        $param = input('post.');
        $res = $this->IndexModel->getList($param);
        if($res){
            return ['data' => $res, 'code' => 200, 'message' => '列表显示成功', 'status' => true ];
        }else{
            return ['data' => [], 'code' => 400, 'message' => '已经到底了哦', 'status' => true ];
        }
    }

    public function index1(){
        $param = input('post.');
        $res = $this->IndexModel->getList1($param);
        if($res){
            return ['data' => $res, 'code' => 200, 'message' => '列表显示成功', 'status' => true ];
        }else{
            return ['data' => [], 'code' => 400, 'message' => '已经到底了哦', 'status' => true ];
        }
    }
    public function detail(){
        $param = input('post.');
        $page = $param['page'] ? $param['page'] : 1;
        $orll_page = config('paginate.list_rows'); 
        $res = $this->IndexModel->getList($param,$page,$orll_page);
        if($res){
            return ['data' => $res, 'code' => 200, 'message' => '列表显示成功', 'status' => true ];
        }else{
            return ['data' => [], 'code' => 400, 'message' => '已经到底了哦', 'status' => true ];
        }
    }
}